<template>
    <div class="content">
        <div v-if="data.data.length > 0">
            <div class="imgbg"
                :style="{ backgroundColor: data.bgcolor, backgroundImage: 'url(' + data.data[0].url + ')', height: data.height + 'px', 'justify-content': data.place == 1 ? 'flex-start' : data.place == 3 ? 'flex-end' : 'center', }">
                <div :style="{ color: data.titlecolor, 'font-weight': data.radio == 1 ? 'bold' : '400' }">
                    {{ data.title }}
                </div>
            </div>
        </div>
        <div v-else>
            <div class="imgbg"
                :style="{ backgroundColor: data.bgcolor, height: data.height + 'px', 'justify-content': data.place == 1 ? 'flex-start' : data.place == 3 ? 'flex-end' : 'center', }">
                <div :style="{ color: data.titlecolor, 'font-weight': data.radio == 1 ? 'bold' : '400' }">
                    {{ data.title }}
                </div>
            </div>
        </div>
    </div>
</template>

<script>

export default {
    name: "propagate",
    props: {
        type: {
            type: [String, Number],
            default: 1
        },
        data: {
            type: Object,
            default: () => { }
        },

    },
    data() {
        return {

        }
    },
    computed: {


    },
    mounted() {
        console.log(this.data, "data")
    }
}
</script>

<style lang="scss" scoped>
.image-null {
    background: #ffffff;
    height: 200px;
    font-size: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1c1c1;
    width: 100%;
}

.content {
    padding: 10px;

    .imgbg {
        background-repeat: no-repeat;
        background-size: 100% 100%;
        width: 100%;
        height: 300px;
        display: flex;
        align-items: center;
        padding: 10px;
    }
}
</style>
